var express = require('express');
var router = express.Router();
 
var userDao = require('../dao/userDao');
 
/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});
 
// 增加用户
router.post('/addUser', function(req, res, next) {
	userDao.add(req, res, next);
});

// 获取全部用户   
router.get('/queryAll', function(req, res, next) {
	userDao.queryAll(req, res, next);
});
 
 //获取单个用户 
router.get('/query', function(req, res, next) {
	userDao.queryById(req, res, next);
});
 
 // 删除一个用户
router.get('/deleteUser', function(req, res, next) {
	userDao.delete(req, res, next);
});
 
//更新一个用户  
router.post('/updateUser', function(req, res, next) {
	userDao.update(req, res, next);
});
 
module.exports = router;